package com.lagou.educourseboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lagou.educourseboot.entity.Course;
import com.lagou.educourseboot.entity.CourseDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @BelongsProject: edu-lagou
 * @Author: GuoAn.Sun
 * @CreateTime: 2021-03-03 15:44
 * @Description:
 */
@Component
public interface CourseMapper extends BaseMapper<Course> {



    //查询所有课程的方法
    List<CourseDTO> getAllCourse();


    //查询已登录用户购买的全部课程信息
    List<CourseDTO> getCourseByUserId(@Param ("userId")Integer userId);

    /**
     * 查询某门课程的详细信息
     * @param courseid 课程编号
     * @return
     */
    CourseDTO getCourseById(@Param ("courseid")Integer courseid);
}
